<include file="public:header" />


<div class="container">
    <br />
    <br />
    <h2>巡检</h2>
    <br />
    <form id="formBox" role="form" action="index.php?g=api&m=inspection&a=addTask" method="post">
        <div class="form-group">
          <select name="storeId[]" class="form-control">
            <volist name="stores" id="store">
            <option value="{$store.id}">{$store.name}</option>
            </volist>
          </select>
        </div>
        <div class="form-group">
          <label for="date1">巡检日期 1</label>
          <input type="text" name="date[]" class="form-control" id="date1">
        </div>
        
        <div class="form-group">
            <select name="storeId[]" class="form-control">
                <volist name="stores" id="store">
                <option value="{$store.id}">{$store.name}</option>
                </volist>
              </select>
        </div>
        <div class="form-group">
          <label for="date2">巡检日期 2</label>
          <input type="text" name="date[]" class="form-control" id="date2">
        </div>
        
        <div class="form-group">
             <select name="storeId[]" class="form-control">
                <volist name="stores" id="store">
                <option value="{$store.id}">{$store.name}</option>
                </volist>
              </select>
        </div>
        <div class="form-group">
          <label for="date3">巡检日期 1</label>
          <input type="text" name="date[]" class="form-control" id="date3">
        </div>

        <button type="submit" class="btn btn-default">Submit</button>
     </form>
</div>

 <hr />
<div class="container">
   
<h2>客户拜访</h2>
<br />
<br />
    <form id="formBoxVisit" role="form" action="index.php?g=api&m=visit&a=addTask" method="post">
        <input type="hidden" name="clientId[]" value="5"/>
        
        <div class="form-group">
             <select name="storeId[]" class="form-control">
                <volist name="stores" id="store">
                <option value="{$store.id}">{$store.name}</option>
                </volist>
              </select>
        </div>
        
        <div class="form-group">
          <label for="date1">拜访日期 1</label>
          <input type="text" name="date[]" class="form-control" id="date1">
        </div>
         <div class="form-group">
          <select name="type[]" class="form-control">
            <option value="client">拜访客户</option>
            <option value="market">市场走访</option>
            <option value="meeting">会议</option>
          </select>
        </div>

        <input type="hidden" name="clientId[]" value="6"/>
        <div class="form-group">
             <select name="storeId[]" class="form-control">
                <volist name="stores" id="store">
                <option value="{$store.id}">{$store.name}</option>
                </volist>
              </select>
        </div>
        
        <div class="form-group">
          <label for="date2">拜访日期 2</label>
          <input type="text" name="date[]" class="form-control" id="date2">
        </div>
         <div class="form-group">
          <select name="type[]" class="form-control">
            <option value="client">拜访客户</option>
            <option value="market">市场走访</option>
            <option value="meeting">会议</option>
          </select>
        </div>
        
        <button type="submit" class="btn btn-default">Submit</button>
     </form>
</div>


<script type="text/javascript">
$(document).ready(function(){
    //绑定一个指定的表单
    $('#formBox').ajaxForm({ 
            //设置传输的数据类型
            dataType:  'json', 
            //请求成功后，调用的回调函数
            success:  back
    }); 
    
    //绑定一个指定的表单
    $('#formBoxVisit').ajaxForm({ 
            //设置传输的数据类型
            dataType:  'json', 
            //请求成功后，调用的回调函数
            success:  back
    }); 
    

    function back(data){
        if(data.status === 200){
            alert(data.msg);
            console.log(data.data);
        }else{
           alert(data.msg);
        }
    }
});


</script>

<include file="public:footer" />